#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int tem;
        int begin, end;
        sort(nums.begin(), nums.end());
        begin = end = 0;
        for (size_t i = 0; i < nums.size(); i++) {
            if (nums[begin] != nums[end]) {
                if (end - begin == 1) {
                    tem = nums[begin];
                    return tem;
                }
                begin = end;
            }
            end++;
        }
        return nums[nums.size() - 1];
    }
};
int main() {
    Solution s;
    vector<int> v;
    v.push_back(2);
    v.push_back(2);
    v.push_back(3);
    v.push_back(2);
    int num = s.singleNumber(v);
    cout << num << endl;
    return 0;
}